const Router = require("koa-router")
const menuSchema = require("../../schema/index/menu")

const router = new Router({ prefix: "/api/menu" })
router.post("/", async (ctx, next) => {
  await menuSchema
    .find({})
    .then(function(list) {
      ctx.body = { menuList: list }
    })
    .catch(function(err) {
      ctx.body = { menuList: [] }
    })
})
module.exports = router
